/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package beanInfo;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author VANTRUY
 */
@Entity
@Table(name = "TourBooking")
@NamedQueries({
    @NamedQuery(name = "TourBooking.findAll", query = "SELECT t FROM TourBooking t"),
    @NamedQuery(name = "TourBooking.findByTourBookID", query = "SELECT t FROM TourBooking t WHERE t.tourBookID = :tourBookID"),
    @NamedQuery(name = "TourBooking.findByRegDate", query = "SELECT t FROM TourBooking t WHERE t.regDate = :regDate"),
    @NamedQuery(name = "TourBooking.findByQty", query = "SELECT t FROM TourBooking t WHERE t.qty = :qty"),
    @NamedQuery(name = "TourBooking.findByRefun", query = "SELECT t FROM TourBooking t WHERE t.refun = :refun"),
    @NamedQuery(name = "TourBooking.findByTotalPrice", query = "SELECT t FROM TourBooking t WHERE t.totalPrice = :totalPrice"),
    @NamedQuery(name = "TourBooking.findByIsValid", query = "SELECT t FROM TourBooking t WHERE t.isValid = :isValid")})
public class TourBooking implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "tourBookID")
    private Integer tourBookID;
    @Column(name = "regDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date regDate;
    @Column(name = "qty")
    private Integer qty;
    @Column(name = "refun")
    private Integer refun;
    @Column(name = "totalPrice")
    private Integer totalPrice;
    @Column(name = "isValid")
    private Boolean isValid;
    @JoinColumn(name = "scheduleID", referencedColumnName = "scheduleID")
    @ManyToOne
    private TourSchedule tourSchedule;
    @JoinColumn(name = "customerID", referencedColumnName = "customerID")
    @ManyToOne
    private Customer customer;

    public TourBooking() {
    }

    public TourBooking(Integer tourBookID) {
        this.tourBookID = tourBookID;
    }

    public Integer getTourBookID() {
        return tourBookID;
    }

    public void setTourBookID(Integer tourBookID) {
        this.tourBookID = tourBookID;
    }

    public Date getRegDate() {
        return regDate;
    }

    public void setRegDate(Date regDate) {
        this.regDate = regDate;
    }

    public Integer getQty() {
        return qty;
    }

    public void setQty(Integer qty) {
        this.qty = qty;
    }

    public Integer getRefun() {
        return refun;
    }

    public void setRefun(Integer refun) {
        this.refun = refun;
    }

    public Integer getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(Integer totalPrice) {
        this.totalPrice = totalPrice;
    }

    public Boolean getIsValid() {
        return isValid;
    }

    public void setIsValid(Boolean isValid) {
        this.isValid = isValid;
    }

    public TourSchedule getTourSchedule() {
        return tourSchedule;
    }

    public void setTourSchedule(TourSchedule tourSchedule) {
        this.tourSchedule = tourSchedule;
    }

    public Customer getCustomer() {
        return customer;
    }

    public void setCustomer(Customer customer) {
        this.customer = customer;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (tourBookID != null ? tourBookID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TourBooking)) {
            return false;
        }
        TourBooking other = (TourBooking) object;
        if ((this.tourBookID == null && other.tourBookID != null) || (this.tourBookID != null && !this.tourBookID.equals(other.tourBookID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "beanInfo.TourBooking[tourBookID=" + tourBookID + "]";
    }

}
